﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Krile
{
    public static class MassiveDataExtends
    {
        public static T[] MassiveToArray<T>(this IEnumerable<T> list)
        {
            if (list == null)
                return null;
            for (int i = 0; i < 1000; i++)
            {
                try
                {
                    return list.ToArray();
                }
                catch (ArgumentException) { }
                System.Threading.Thread.Sleep(0);
            }
            throw new KrileManagementException("MassiveArray controlling failed!");
        }
    }
}

